<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<head>
    <th:block th:include="common/include :: header('编辑员工信息')"/>
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
    <form class="form-horizontal m" id="form-employee-edit" th:object="${employee}">
        <input name="id" th:field="*{id}" type="hidden">
        <div class="form-group">
            <label class="col-sm-3 control-label">姓名：</label>
            <div class="col-sm-8">
                <input name="name" th:field="*{name}" class="form-control" type="text">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">邮箱：</label>
            <div class="col-sm-8">
                <input name="email" th:field="*{email}" class="form-control" type="text">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">年龄：</label>
            <div class="col-sm-8">
                <input name="age" th:field="*{age}" class="form-control" type="text">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">性别：</label>
            <div class="col-sm-8">
                <select name="sex" class="form-control m-b" th:with="type=${@dict.getType('sys_user_sex')}">
                    <option th:each="dict : ${type}" th:text="${dict.label}" th:value="${dict.value}"
                            th:field="*{sex}"></option>
                </select>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">是否是超管：</label>
            <div class="col-sm-8">
                <select name="admin" class="form-control m-b" th:with="type=${@dict.getType('bus_yes_or_no')}">
                    <option th:each="dict : ${type}" th:text="${dict.label}" th:value="${dict.value}"
                            th:field="*{admin}"></option>
                </select>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">入职时间：</label>
            <div class="col-sm-8">
                <div class="input-group date">
                    <input name="hiredate" class="time-input" placeholder="yyyy-MM-dd" type="text" th:field="*{hiredate}">
                </div>
            </div>
        </div>

        <div class="form-group">
            <label class="col-sm-3 control-label">所在部门：</label>
            <div class="col-sm-8">
                <select name="deptId" class="form-control m-b" th:with="type=${@dict.getType('bus_dept')}">
                    <option th:each="dict : ${type}"
                            th:text="${dict.label}"
                            th:value="${dict.value}"
                            th:field="*{deptId}"></option>
                </select>
            </div>
        </div>

    </form>
</div>
<th:block th:include="common/include :: footer"/>
<th:block th:include="common/include :: datetimepicker"/>
<script th:inline="javascript">
    var prefix = ctx + "/business/employee";
    $("#form-employee-edit").validate({
        focusCleanup: true
    });

    function submitHandler() {
        if ($.validate.form()) {
            $.operate.save(prefix + "/edit", $('#form-employee-edit').serialize());
        }
    }

    $("input[name='actualArrivalTime']").datetimepicker({
        format: "yyyy-mm-dd hh:ii",
        autoclose: true
    });
</script>
</body>
</html>